﻿<%@ page language="C#" masterpagefile="~/MasterPage.master" autoeventwireup="true" inherits="SysManage, App_Web_zodh6prk" title="Untitled Page" %>

        <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<ul class="box">
<li><a href="#">公告管理</a>
<ul>
<li>
    <asp:LinkButton ID="lbtnNotice" runat="server" CausesValidation="False" OnClick="lbtnNotice_Click">公告列表</asp:LinkButton></li><li>
        <asp:LinkButton ID="lbtnAddNotice" runat="server" CausesValidation="False" OnClick="lbtnAddNotice_Click">添加公告</asp:LinkButton></li></ul>
</li>
        <li><a href="#">角色管理</a>
        <ul>
        <li><asp:LinkButton ID="lbtnRoleList" runat="server" OnClick="lbtnRoleList_Click" CausesValidation="False">角色列表</asp:LinkButton></li><li><asp:LinkButton ID="lbtnAddRole" runat="server" OnClick="lbtnAddRole_Click" CausesValidation="False">新增角色</asp:LinkButton></li><li></li><li><asp:LinkButton ID="lbtnRoleMemberManage" runat="server" CausesValidation="False" OnClick="lbtnRoleMemberManage_Click">成员管理</asp:LinkButton></li><li><asp:LinkButton ID="lbtnRolePermit" runat="server" CausesValidation="False" OnClick="lbtnRolePermit_Click">权限设置</asp:LinkButton></li></ul>
        </li>
        <li><a href="#">用户管理</a>
          <!-- Active -->
          <ul>
            <li>
            <asp:LinkButton ID="lbtnUserList" runat="server" OnClick="lbtnUserList_Click" CausesValidation="False">用户列表</asp:LinkButton></li><li><asp:LinkButton ID="lbtnNewUser" runat="server" OnClick="lbtnNewUser_Click" CausesValidation="False">新增用户</asp:LinkButton></li><li><asp:LinkButton ID="lbtnUserPermit" runat="server" CausesValidation="False" OnClick="lbtnUserPermit_Click">权限设置</asp:LinkButton></li></ul>
        </li>
        
        </ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
 <asp:Panel id="pnlAddNotice" runat="server">新增公告<BR />
 <TABLE><TBODY>
 <TR><TD>公告标题</TD><TD><asp:TextBox id="txtNoticeTitle" width="300px" runat="server"></asp:TextBox></TD><TD><asp:RequiredFieldValidator id="RequiredFieldValidator4" runat="server" ErrorMessage="请输入公告标题" ControlToValidate="txtNoticeTitle"></asp:RequiredFieldValidator></TD></TR>
 <TR><TD valign="top">公告内容</TD><TD><asp:TextBox id="txtNoticeContent" width="300px" runat="server" TextMode="MultiLine" Height="74px"></asp:TextBox></TD><TD></TD></TR><TR><TD colSpan=3><asp:Button id="btnAddNotice" runat="server" Text="添加公告" OnClick="btnAddNotice_Click"></asp:Button></TD></TR></TBODY></TABLE></asp:Panel>
 <!-- 初始面板 -->
  <asp:Panel id="pnlInit" runat="server">当前应用 
    <asp:GridView ID="gvApplication" runat="server" Width="635px" AutoGenerateColumns="False">
        <Columns>
            <asp:BoundField DataField="AppID" HeaderText="ID">
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" />
            </asp:BoundField>
            <asp:BoundField DataField="AppName" HeaderText="应用程序名">
                <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="150px" />
            </asp:BoundField>
            <asp:BoundField DataField="AppDesc" HeaderText="描述">
                <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="300px" />
            </asp:BoundField>
            <asp:HyperLinkField HeaderText="查看模块及功能" Text="查看模块及功能">
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:HyperLinkField>
        </Columns>
    </asp:GridView>         
    </asp:Panel> <!-- End 初始面板 -->
    <!-- 公告面板 -->
    <asp:Panel id="pnlNoticeList" runat="server">公告列表<BR /><asp:GridView id="gvNotice" runat="server" OnRowDeleting="gvNotice_RowDeleting">
        <Columns>
            <asp:CommandField ShowDeleteButton="True">
                <ItemStyle Width="30px" />
            </asp:CommandField>
        </Columns>
    </asp:GridView></asp:Panel>
    <!-- End 公告面板 -->
<!-- 用户面板 --><asp:Panel id="pnlUserManager" runat="server" Visible="false"><asp:LinkButton id="lbtnShowAllUser" onclick="lbtnShowAllUser_Click" runat="server">全部用户</asp:LinkButton> <asp:LinkButton id="lbtnShowApproveUser" onclick="lbtnShowApproveUser_Click" runat="server">未审核用户</asp:LinkButton> <asp:LinkButton id="lbtnShowDenyUser" onclick="lbtnShowDenyUser_Click" runat="server">屏蔽用户</asp:LinkButton> <asp:LinkButton id="lbtnShowActiveUser" onclick="lbtnShowActiveUser_Click" runat="server">未激活用户</asp:LinkButton> <asp:LinkButton id="lbtnShowOnlineUser" onclick="lbtnShowOnlineUser_Click" runat="server">在线用户</asp:LinkButton> <BR /><asp:GridView id="gvUserList" runat="server" Width="700px" AutoGenerateColumns="False" OnRowDataBound="gvUserList_RowDataBound" OnRowDeleting="gvUserList_RowDeleting" OnRowCommand="gvUserList_RowCommand"><Columns>
<asp:TemplateField HeaderText="用户ID"><ItemTemplate>
 <%#   (Container.DataItemIndex+1).ToString()%> 
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="UserID" HeaderText="ID" Visible="False"></asp:BoundField>
<asp:BoundField DataField="UserName" HeaderText="用户名"></asp:BoundField>
<asp:BoundField DataField="DateCreated" HeaderText="创建日期"></asp:BoundField>
<asp:BoundField DataField="Email" HeaderText="Email"></asp:BoundField>
<asp:CheckBoxField DataField="IsAdmin" HeaderText="管理员"></asp:CheckBoxField>
<asp:CheckBoxField DataField="IsOnline" HeaderText="在线"></asp:CheckBoxField>
<asp:CheckBoxField DataField="IsApproved" HeaderText="已审核"></asp:CheckBoxField>
<asp:CheckBoxField DataField="IsAllow" HeaderText="允许"></asp:CheckBoxField>
<asp:CommandField SelectText="详细" ShowSelectButton="True" HeaderText="查看"></asp:CommandField>
<asp:TemplateField HeaderText="密码"><ItemTemplate>
<asp:LinkButton id="lbtnResetPwd" runat="server" OnCommand="lbtnResetPwd_Command">重置密码</asp:LinkButton> 
</ItemTemplate>

<ItemStyle HorizontalAlign="Center" Width="60px"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="删除" ShowHeader="False"><ItemTemplate>
<asp:LinkButton id="lbtnUserDel" runat="server" Text="删除" CausesValidation="False" CommandName="Delete"></asp:LinkButton> 
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView> <asp:LinkButton id="lbtnCreateNewUser" onclick="lbtnNewUser_Click" runat="server">创建新用户</asp:LinkButton> <BR /><asp:Label id="lblUserMsg" runat="server"></asp:Label></asp:Panel> <!-- End 用户面板 --><!-- 角色面板 --><asp:Panel id="pnlRoleManager" runat="server" Visible="false">
  <asp:GridView id="gvRoleList" runat="server" AutoGenerateColumns="False" Width="635px" OnRowDataBound="gvRoleList_RowDataBound" OnRowDeleting="gvRoleList_RowDeleting">
    <Columns>
<asp:BoundField DataField="RoleID" HeaderText="ID">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="RoleName" HeaderText="角色名称">
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="150px"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="RoleDesc" HeaderText="描述">
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="300px"></ItemStyle>
</asp:BoundField>
<asp:CheckBoxField DataField="IsSystem" Text="系统角色" HeaderText="系统角色">
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="120px"></ItemStyle>
</asp:CheckBoxField>
<asp:CheckBoxField DataField="IsUser" Text="用户角色" HeaderText="用户角色">
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="120px"></ItemStyle>
</asp:CheckBoxField>
<asp:CommandField SelectText="查看角色" ShowSelectButton="True" HeaderText="查看">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="100px"></ItemStyle>
</asp:CommandField>
<asp:CommandField SelectText="成员管理" ShowSelectButton="True" HeaderText="成员管理">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="100px"></ItemStyle>
</asp:CommandField>
<asp:TemplateField HeaderText="删除" ShowHeader="False"><ItemTemplate>
<asp:LinkButton id="lbtnRoleDel" runat="server" Text="删除" CausesValidation="False"  CommandName="Delete"></asp:LinkButton> 
</ItemTemplate>

<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="60px"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
 <asp:LinkButton id="lbtnCreateNewRole" onclick="lbtnAddRole_Click" runat="server">创建新角色</asp:LinkButton>
 </asp:Panel> <!--End 角色面板 --><!-- 新增用户面板 --><asp:Panel id="pnlAddUser" runat="server">
  <P class="tit">创建新用户</P>
  <TABLE><TBODY>
  <TR><TD>用户名</TD><TD><asp:TextBox id="txtUserName" runat="server"></asp:TextBox></TD>
  <TD><asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ControlToValidate="txtUserName" ErrorMessage="请输入用户名"></asp:RequiredFieldValidator></TD></TR>
  <TR><TD>密码</TD><TD><asp:TextBox id="txtPassword" runat="server" TextMode="Password"></asp:TextBox></TD>
  <TD><asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server" ControlToValidate="txtPassword" ErrorMessage="请输入密码"></asp:RequiredFieldValidator> </TD></TR>
  <TR><TD>确认密码</TD><TD><asp:TextBox id="txtPassword1" runat="server" TextMode="Password"></asp:TextBox></TD>
  <TD><asp:CompareValidator id="CompareValidator1" runat="server" ControlToValidate="txtPassword1" ErrorMessage="密码不一致，请重输" ControlToCompare="txtPassword"></asp:CompareValidator></TD></TR>
  <TR><TD>Email</TD><TD><asp:TextBox id="txtEmail" runat="server"></asp:TextBox></TD><TD></TD></TR>
  <TR><TD>性别</TD><TD><asp:DropDownList id="ddlGender" runat="server" Width="70px">
                      <asp:ListItem Value="0">未知</asp:ListItem>
                      <asp:ListItem Value="1">男</asp:ListItem>
                      <asp:ListItem Value="2">女</asp:ListItem>
                  </asp:DropDownList></TD><TD></TD></TR>
                  <tr><td>是否管理员</td><td>
                      <asp:RadioButtonList ID="rblIsAdmin" runat="server" RepeatDirection="Horizontal"
                          Width="142px">
                          <asp:ListItem Selected="True" Value="False">否</asp:ListItem>
                          <asp:ListItem Value="True">是</asp:ListItem>
                      </asp:RadioButtonList></td><td></td></tr>
                  <tr><td>是否通过审核</td><td>
                      <asp:RadioButtonList ID="rblIsApproved" runat="server" RepeatDirection="Horizontal"
                          Width="142px">
                          <asp:ListItem Selected="True" Value="False">否</asp:ListItem>
                          <asp:ListItem Value="True">是</asp:ListItem>
                      </asp:RadioButtonList></td><td>通过审核后方可登录</td></tr>
                  <tr><td>是否激活</td><td>
                      <asp:RadioButtonList ID="rblIsActive" runat="server" RepeatDirection="Horizontal"
                          Width="142px">
                          <asp:ListItem Selected="True" Value="False">否</asp:ListItem>
                          <asp:ListItem Value="True">是</asp:ListItem>
                      </asp:RadioButtonList></td><td>激活后方可登录</td></tr>
                  <tr><td>是否许可</td><td>
                      <asp:RadioButtonList ID="rblIsAllow" runat="server" RepeatDirection="Horizontal"
                          Width="142px">
                          <asp:ListItem Selected="True" Value="False">否</asp:ListItem>
                          <asp:ListItem Value="True">是</asp:ListItem>
                      </asp:RadioButtonList></td><td>授权许可后方可登录</td></tr>
                  <TR><TD>密码提示问题</TD><TD><asp:TextBox id="txtQuestion" runat="server"></asp:TextBox></TD><TD></TD></TR>
                  <TR><TD>提示问题答案</TD><TD><asp:TextBox id="txtAnswer" runat="server"></asp:TextBox></TD><TD></TD></TR>
                  <TR><TD>验证码</TD><TD><asp:TextBox id="txtSalt" runat="server"></asp:TextBox></TD><TD><asp:Image id="Image1" runat="server" ImageUrl="~/validatecode.aspx"></asp:Image></TD></TR>
                  <TR><TD colSpan=3><asp:Button id="btnAddUser" onclick="btnAddUser_Click" runat="server" Text="添加用户"></asp:Button></TD></TR></TBODY></TABLE>
                  <asp:Label id="lbUserMsg" runat="server"></asp:Label> <asp:LinkButton id="lbtnReturnUserList" onclick="lbtnReturnUserList_Click" runat="server" CausesValidation="False">返回用户列表</asp:LinkButton> </asp:Panel> <!-- End 新增用户面板 --><!-- 新增角色面板 --><asp:Panel id="pnlAddRole" runat="server"><P class="tit">创建新角色</P>
                   <TABLE><TBODY><TR><TD>角色名</TD><TD style="WIDTH: 216px"><asp:TextBox id="txtRoleName" runat="server"></asp:TextBox></TD>
                   <TD><asp:RequiredFieldValidator id="RequiredFieldValidator3" runat="server" ErrorMessage="请输入角色名称" ControlToValidate="txtRoleName"></asp:RequiredFieldValidator></TD></TR><TR><TD>描述</TD><TD style="WIDTH: 216px"><asp:TextBox id="txtRoleDesc" runat="server" TextMode="MultiLine" Height="78px"></asp:TextBox></TD><TD></TD></TR>
                   <TR><TD>角色管理员</TD><TD style="WIDTH: 216px"><asp:TextBox id="txtRoleAdmin" runat="server"></asp:TextBox></TD><TD></TD></TR>
                   <TR><TD>系统角色</TD><TD style="WIDTH: 216px"><asp:CheckBox id="cbIsSystem" runat="server" Enabled="false" Checked="false"></asp:CheckBox></TD><TD></TD></TR>
                   <TR><TD>用户角色</TD><TD style="WIDTH: 216px"><asp:CheckBox id="cbIsUser" runat="server" Enabled="False" Checked="true"></asp:CheckBox></TD><TD></TD></TR>
                   <TR><TD colSpan=3><asp:Button id="btnAddRole" runat="server" Text="添加角色" OnClick="btnAddRole_Click"></asp:Button></TD></TR></TBODY></TABLE>
                   <asp:Label id="lbRoleMsg" runat="server"></asp:Label><BR />
                   <asp:LinkButton id="lbtnReturnRoleList" runat="server" CausesValidation="False" OnClick="lbtnReturnRoleList_Click">返回角色列表</asp:LinkButton></asp:Panel> <asp:Panel id="pnlMemberManage" runat="server">角色成员管理<BR />角色：<asp:DropDownList id="ddlRoles" runat="server" Width="113px"></asp:DropDownList> <asp:Button id="btnShowMembers" onclick="btnShowMembers_Click" runat="server" Text="查看成员"></asp:Button> <TABLE width="95%" border=1><TBODY><TR><TD><asp:DataList id="dlMembers" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" ForeColor="#333333" CellPadding="4" RepeatColumns="10">
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White"></FooterStyle>

<AlternatingItemStyle BackColor="White"></AlternatingItemStyle>

<ItemStyle BackColor="#EFF3FB"></ItemStyle>

<SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333"></SelectedItemStyle>

<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White"></HeaderStyle>
<ItemTemplate>
<DIV style="FLOAT: left; WIDTH: 90px"><asp:CheckBox id="cbUserName" runat="server" Text='<%# Eval("username") %>' Checked="false"></asp:CheckBox> </DIV><asp:Label id="lblUserid" runat="server" Text='<%# Eval("userid") %>' Visible="False"></asp:Label> 
</ItemTemplate>
</asp:DataList></TD></TR></TBODY></TABLE><asp:CheckBox id="cbCheckAll" runat="server" Text="全选" OnCheckedChanged="cbCheckAll_CheckedChanged" AutoPostBack="True" TextAlign="Left"></asp:CheckBox>&nbsp;<asp:Button id="btnDelMember" onclick="btnDelMember_Click" runat="server" Text="移除成员"></asp:Button><BR /><TABLE width="95%" border=1><TBODY><TR><TD><asp:DataList id="dlAllUsers" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" ForeColor="#333333" CellPadding="4" RepeatColumns="10">
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White"></FooterStyle>

<AlternatingItemStyle BackColor="White"></AlternatingItemStyle>

<ItemStyle BackColor="#EFF3FB"></ItemStyle>

<SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333"></SelectedItemStyle>

<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White"></HeaderStyle>
<ItemTemplate>
<DIV style="FLOAT: left; WIDTH: 90px"><asp:CheckBox id="cbUserName2" runat="server" Text='<%# Eval("username") %>' Checked="false"></asp:CheckBox> </DIV><asp:Label id="lblUserid2" runat="server" Text='<%# Eval("userid") %>' Visible="False"></asp:Label> 
</ItemTemplate>
</asp:DataList></TD></TR></TBODY></TABLE><asp:CheckBox id="cbCheckAll2" runat="server" Text="全选" OnCheckedChanged="cbCheckAll2_CheckedChanged" AutoPostBack="True" TextAlign="Left"></asp:CheckBox>&nbsp; <asp:Button id="btnAddToRole" onclick="btnAddToRole_Click" runat="server" Text="添加到角色"></asp:Button> <asp:DropDownList id="ddlRoles2" runat="server" Width="113px"></asp:DropDownList><BR /><BR /><asp:Label id="lblMemberMsg" runat="server"></asp:Label></asp:Panel> <!-- End 新增角色面板 --><!-- 角色权限面板 --><asp:Panel id="pnlRolePermit" runat="server" Width="686px">角色权限设置 <BR />选择角色：<asp:DropDownList id="ddlRoles3" runat="server" Width="149px"></asp:DropDownList> <asp:Button id="btnReadRolePermit" onclick="btnReadRolePermit_Click" runat="server" Text="读取并设置角色权限"></asp:Button> 
<HR />
应用程序授权<asp:DropDownList id="ddlApplication" runat="server" Width="175px" Enabled="False"></asp:DropDownList> <asp:Button id="Button2" onclick="Button2_Click" runat="server" Text="设置"></asp:Button><BR />应用程序模块及功能授权 
<HR />
<TABLE border=0><TBODY><TR><TD vAlign=top><asp:DataList id="dlModules" runat="server"><ItemTemplate>
<asp:LinkButton id="lbtnModule" runat="server" Text='<%# Eval("ModuleName") %>' OnClick="lbtnModule_Click"></asp:LinkButton> <asp:Label id="lblModuleId" runat="server" Text='<%# Eval("moduleid") %>' Visible="False"></asp:Label>
</ItemTemplate>
</asp:DataList></TD><TD vAlign=top><asp:GridView id="gvFunction" runat="server" AutoGenerateColumns="False"><Columns>
<asp:BoundField DataField="functionid" HeaderText="ID"></asp:BoundField>
<asp:BoundField DataField="functionName" HeaderText="功能名称"></asp:BoundField>
<asp:BoundField DataField="functionDesc" HeaderText="功能描述"></asp:BoundField>
<asp:TemplateField HeaderText="许可"><EditItemTemplate>
<asp:CheckBox id="CheckBox1" runat="server"></asp:CheckBox>
</EditItemTemplate>
<ItemTemplate>
<asp:CheckBox id="cbAllow" runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="禁止"><EditItemTemplate>
<asp:CheckBox id="CheckBox2" runat="server"></asp:CheckBox>
</EditItemTemplate>
<ItemTemplate>
<asp:CheckBox id="cbDeny" runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView></TD></TR></TBODY></TABLE>&nbsp; <asp:Label id="lblRoleId" runat="server"></asp:Label> <asp:Label id="lblAppId" runat="server" Width="50px"></asp:Label> <asp:Label id="lblModuleId" runat="server"></asp:Label> <asp:Label id="lblAllow" runat="server"></asp:Label><BR /><asp:Label id="lblDeny" runat="server"></asp:Label><BR /><asp:Button id="btnSetRolePermit" onclick="btnSetRolePermit_Click" runat="server" Text="保存"></asp:Button> <BR /><asp:Label id="lblRolePermitMsg" runat="server"></asp:Label></asp:Panel> <!-- 用户权限面板 --><asp:Panel id="pnlUserPermit" runat="server">用户权限设置<BR /><asp:Button id="Button1" runat="server" Text="恢复默认权限设置"></asp:Button></asp:Panel> 
</ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

